package com.ruoyi.nongjt.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.nongjt.domain.InspectionRecord;
import com.ruoyi.nongjt.mapper.InspectionRecordMapper;
import com.ruoyi.nongjt.service.InspectionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 检查记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
@Service
public class InspectionRecordServiceImpl implements InspectionRecordService 
{
    @Autowired
    private InspectionRecordMapper inspectionRecordMapper;

    /**
     * 查询检查记录
     * 
     * @param id 检查记录主键
     * @return 检查记录
     */
    @Override
    public InspectionRecord selectInspectionRecordById(Long id)
    {
        return inspectionRecordMapper.selectInspectionRecordById(id);
    }

    /**
     * 查询检查记录列表
     * 
     * @param inspectionRecord 检查记录
     * @return 检查记录
     */
    @Override
    public List<InspectionRecord> selectInspectionRecordList(InspectionRecord inspectionRecord)
    {
        return inspectionRecordMapper.selectInspectionRecordList(inspectionRecord);
    }

    /**
     * 新增检查记录
     * 
     * @param inspectionRecord 检查记录
     * @return 结果
     */
    @Override
    public int insertInspectionRecord(InspectionRecord inspectionRecord)
    {
        inspectionRecord.setCreateTime(DateUtils.getNowDate());
        return inspectionRecordMapper.insertInspectionRecord(inspectionRecord);
    }

    /**
     * 修改检查记录
     * 
     * @param inspectionRecord 检查记录
     * @return 结果
     */
    @Override
    public int updateInspectionRecord(InspectionRecord inspectionRecord)
    {
        inspectionRecord.setUpdateTime(DateUtils.getNowDate());
        return inspectionRecordMapper.updateInspectionRecord(inspectionRecord);
    }

    /**
     * 批量删除检查记录
     * 
     * @param ids 需要删除的检查记录主键
     * @return 结果
     */
    @Override
    public int deleteInspectionRecordByIds(Long[] ids)
    {
        return inspectionRecordMapper.deleteInspectionRecordByIds(ids);
    }

    /**
     * 删除检查记录信息
     * 
     * @param id 检查记录主键
     * @return 结果
     */
    @Override
    public int deleteInspectionRecordById(Long id)
    {
        return inspectionRecordMapper.deleteInspectionRecordById(id);
    }

    /**
     * 逻辑删除检查记录
     * 
     * @param id 检查记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteInspectionRecordById(Long id)
    {
        return inspectionRecordMapper.logicDeleteInspectionRecordById(id);
    }

    /**
     * 批量逻辑删除检查记录
     * 
     * @param ids 需要删除的检查记录主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteInspectionRecordByIds(Long[] ids)
    {
        return inspectionRecordMapper.logicDeleteInspectionRecordByIds(ids);
    }
}
